<template>
	<view class="">
		<u-tabs :list="tabList" active-color="#FF7A23" :current="tabIndex" @change="onTabChange"></u-tabs>

		<view v-if="tabIndex === 0">
			<u-cell-group style="margin-top: 10rpx;">
				<u-cell-item :arrow="false" title="金蝶编码" :value="data.Ke_Dealer_BaseInfo.KeDealerNo"></u-cell-item>
				<u-cell-item :arrow="false" title="公司名称" :value="data.Ke_Dealer_BaseInfo.Name"></u-cell-item>
				<u-cell-item :arrow="false" title="公司英文名称" value=""></u-cell-item>
				<u-cell-item :arrow="false" title="负责人姓名" :value="data.Ke_Dealer_BaseInfo.NickName"></u-cell-item>
				<u-cell-item :arrow="false" title="负责人手机号" :value="data.Ke_Dealer_BaseInfo.Mobile"></u-cell-item>
				<u-cell-item :arrow="false" title="公司联系电话" :value="data.Ke_Dealer_BaseInfo.Telephone"></u-cell-item>
				<u-cell-item :arrow="false" title="等级" :value="data.Ke_Dealer_BaseInfo.KeLevelName"></u-cell-item>
				<u-cell-item :arrow="false" title="配件级别" :value="data.Ke_Dealer_BaseInfo.PartsLevel"></u-cell-item>
				<u-cell-item :arrow="false" title="渠道">
					<u-radio-group :value="data.Ke_Dealer_OtherInfo.DealerType">
						<view class="grid-2">
							<u-radio v-for="(item, index) in metadata.DealerType_BaseList" :key="index" :name="item.Key">{{ item.Value }}</u-radio>
						</view>
					</u-radio-group>
				</u-cell-item>
				<u-cell-item :arrow="false" title="经营品类">
					<u-checkbox-group>
						<view class="grid-2">
							<u-checkbox :disabled="true" v-model="item.checked" v-for="(item, index) in metadata.BusinessCategory_BaseList" :name="item.Key" :key="index">
								{{ item.Value }}
							</u-checkbox>
						</view>
					</u-checkbox-group>
				</u-cell-item>
				<u-cell-item :arrow="false" title="BDR品牌">
					<u-checkbox-group>
						<view class="grid-2">
							<u-checkbox :disabled="true" v-model="item.checked" v-for="(item, index) in metadata.CompetingGoodsBrandA_BaseList" :key="index" :name="item.Key">
								{{ item.Value }}
							</u-checkbox>
						</view>
					</u-checkbox-group>
				</u-cell-item>
				<u-cell-item :arrow="false" title="进口品牌">
					<u-checkbox-group>
						<view class="grid-2">
							<u-checkbox :disabled="true" v-model="item.checked" class="grid-item" v-for="(item, index) in metadata.CompetingGoodsBrandB_BaseList" :key="index" :name="item.Key">
								{{ item.Value }}
							</u-checkbox>
						</view>
					</u-checkbox-group>
				</u-cell-item>
				<u-cell-item :arrow="false" title="国产品牌">
					<u-checkbox-group>
						<view class="grid-2">
							<u-checkbox :disabled="true" v-model="item.checked" v-for="(item, index) in metadata.CompetingGoodsBrandC_BaseList" :key="index" :name="item.Key">
								{{ item.Value }}
							</u-checkbox>
						</view>
					</u-checkbox-group>
				</u-cell-item>
				<u-cell-item :arrow="false" title="BDR销售额">
					<view class="u-flex-col u-col-bottom">
						<view>
							<text>{{ data.Ke_Dealer_OtherInfo.LastYearsBDRSales }}</text>
							<text class="unit u-m-l-32">万元</text>
						</view>
					</view>
				</u-cell-item>

				<u-cell-item :arrow="false" title="总销售额">
					<view class="u-flex-col u-col-bottom">
						<view>
							<text>{{ data.Ke_Dealer_OtherInfo.TotalSales }}</text>
							<text class="unit u-m-l-32">万元</text>
						</view>
					</view>
				</u-cell-item>
				<u-cell-item :arrow="false" title="BDR销售额占比">
					<view class="u-flex-col u-col-bottom">
						<view>
							<text>{{ data.Ke_Dealer_OtherInfo.PercentageBDRSales }}%</text>
						</view>
					</view>
				</u-cell-item>
				<u-cell-item :arrow="false" title="人员数量" :value="data.Ke_Dealer_OtherInfo.PeopleNum"></u-cell-item>
				<u-cell-item :arrow="false" title="是否签约服务商">
					<view style="padding-left: 100rpx;">
						<u-radio-group :value="data.Ke_Dealer_OtherInfo.IsSign">
							<view class="grid-2">
								<u-radio :name="1">是</u-radio>
								<u-radio :name="0">否</u-radio>
							</view>
						</u-radio-group>
					</view>
				</u-cell-item>
			</u-cell-group>
		</view>

		<view v-if="tabIndex === 1">
			<relations :list="data.Ke_Dealer_RelationList"></relations>
		</view>

		<view v-if="tabIndex === 2">
			<u-cell-group>
				<u-cell-item :arrow="false" title="地址">
					<city-select :disabled="true" :value="[data.Ke_Dealer_BaseInfo.ProvinceId, data.Ke_Dealer_BaseInfo.CityId, data.Ke_Dealer_BaseInfo.DistrictId]"></city-select>
					<u-input :disabled="true" inputAlign="right" placeholder="" :value="data.Ke_Dealer_BaseInfo.Address"></u-input>
				</u-cell-item>
				<u-cell-item :arrow="false" title="发票抬头" :value="data.Ke_DealerInvoiceInfo.Rise"></u-cell-item>
				<u-cell-item :arrow="false" title="开户银行" :value="data.Ke_DealerInvoiceInfo.BankName"></u-cell-item>
				<u-cell-item :arrow="false" title="开票联系地址" :value="data.Ke_DealerInvoiceInfo.InvoiceAdress"></u-cell-item>
				<u-cell-item :arrow="false" title="开票联系电话" :value="data.Ke_Dealer_BaseInfo.InvoicePhone"></u-cell-item>
			</u-cell-group>
		</view>
	</view>
</template>

<script>
export default {
	name: 'jindie-information',
	props: {
		data: {
			type: Object,
			default() {
				return {
					Ke_Dealer_BaseInfo: {
						PartsLevel: 'A',
						KeLevelName: '一级',
						Channel: '',
						DealerId: 8871,
						Name: '南京跨迹商贸有限公司',
						Referred: '南京跨迹',
						Account: '',
						KeDealerNo: '01000657',
						NickName: '魏凯',
						Mobile: '186-5201-6912',
						Telephone: ' ',
						Level: 0,
						LevelName: '',
						ProvinceId: 320000,
						CityId: 320100,
						DistrictId: 320106,
						Address: ' ',
						Delivery_ProvinceId: 0,
						Delivery_CityId: 0,
						Delivery_DistrictId: 0,
						Delivery_Address: '',
						Parent_DealerId: 0,
						Parent_Name: '',
						State: 1,
						Created: 1615789906,
						IsFictitious: 0
					},
					Ke_Dealer_OtherInfo: {
						DealerType: 0,
						BusinessCategory: '',
						CompetingGoodsBrandA: '',
						CompetingGoodsBrandB: '',
						CompetingGoodsBrandC: '',
						LastYearsBDRSales: 0,
						TotalSales: 0,
						PercentageBDRSales: 0,
						PeopleNum: 0,
						DealerGrade: 0,
						BlessingNote: '',
						BossName: '',
						BossPhone: '',
						BossBirthday: 0,
						IsVIP: 0,
						BusinessLicenseA: '',
						TreatyPhoto: '',
						TreatyPhotoType: 1,
						IsSign: 0
					},
					Ke_Dealer_RelationList: [],
					Ke_DealerInvoiceInfo: {
						Rise: '南京跨迹商贸有限公司',
						BankName: '中国建设银行股份有限公司南京雨花开发区支行',
						BankNumber: '32050159980000000928',
						InvoiceAdress: '南京市鼓楼区草场门大街石头城路6号',
						InvoicePhone: '02586451768',
						Remark: ''
					}
				};
			}
		},
		metadata: {
			type: Object,
			default() {
				return {
					BusinessCategory_BaseList: [],
					CompetingGoodsBrandA_BaseList: [],
					CompetingGoodsBrandB_BaseList: [],
					CompetingGoodsBrandC_BaseList: [],
					DealerApplyFor_BaseList: [],
					DealerGrade_BaseList: [],
					DealerMaterialRequirements_BaseList: [],
					DealerShutDown_BaseList: [],
					DealerType_BaseList: [],
					DealerAndGoReason_BaseList: []
				};
			}
		}
	},
	data() {
		return {
			tabList: [{ name: '基本信息' }, { name: '销售业务关系' }, { name: '开票信息' }],
			tabIndex: 0
		};
	},

	methods: {
		onTabChange(index) {
			this.tabIndex = index;
		}
	}
};
</script>

<style lang="scss" scoped>
.section {
	margin: 20rpx;
}
</style>
